package com.ericsson.enap.modules.topology.entity;

import lombok.Getter;
import lombok.Setter;

import java.util.List;
import java.util.Objects;

@Setter
@Getter
public class Cvs {
    private String sourceName;
    private String sourcePort;
    private String targetName;
    private String targetPort;
    private List<Integer> vlan;
    private String originalVlan;
    private int edgeType;  //1 switch - server  2 switch-switch
    private Long sourceId;
    private Long targetId;
    private Integer labId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Cvs cvs = (Cvs) o;
        return sourceName.equalsIgnoreCase(cvs.sourceName) &&
                sourcePort.equalsIgnoreCase(cvs.sourcePort) &&
                targetName.equalsIgnoreCase(cvs.targetName) &&
                targetPort.equalsIgnoreCase(cvs.targetPort);
    }

    @Override
    public int hashCode() {
        return Objects.hash(sourceName, sourcePort, targetName, targetPort);
    }

}
